function request(reqURL,process,att,thisid){
	var reqVALUE=document.getElementById(thisid).value;//表单值
    if(reqVALUE.match(/[^\x00-\xff]/ig)){
		document.getElementById(thisid).className='t_input_no';
		document.getElementById(att).className='ckno';
		document.getElementById(att).innerHTML='您的输入法设置为全角中文格式，请调整成半角英文格式输入卡号。';
		return false;
	}
	var reqURL=encodeURI(reqURL+'?'+thisid+'='+reqVALUE+'&'+'t='+Math.random());//UTF-8下要用encodeURI
	var xmlHttp = false;//开始初始化XMLHttpRequest对象
	if (thisid=='cardno'){//如果是判断卡号
		if (reqVALUE.length<10){
			document.getElementById(thisid).className='t_input_no';
			document.getElementById(att).className='ckno';
			document.getElementById(att).innerHTML='对不起，您的卡号位数不正确，请认真检查。';
			return false;
		}
	}
	
	if(window.XMLHttpRequest){ //Mozilla 浏览器
		xmlHttp = new XMLHttpRequest();
		if(xmlHttp.overrideMimeType) {//设置MiME类别
			xmlHttp.overrideMimeType('text/xml');
		}
	}
	else if (window.ActiveXObject) { // IE浏览器
		try {
			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e) {
			try {
				xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e) {}
		}
	}
	if(!xmlHttp) { // 异常，创建对象实例失败
		alert("不能创建XMLHttpRequest对象实例.");
		return false;
	}
	xmlHttp.open('GET',reqURL,'true');
	xmlHttp.onreadystatechange = function handleStateChange(){
		if(xmlHttp.readyState == 2) {
			//document.getElementById("tishi").innerHTML = "正在载入......";
		}
		if(xmlHttp.readyState == 4) {
			if(xmlHttp.status == 200) {
				//alert(xmlHttp.responseText);
				process(xmlHttp.responseText,att,thisid);
			}
		}
	}
	xmlHttp.send(null);
}

function ck_cardno(str,att,thisid){
	if (str==0){
		document.getElementById(thisid).className='t_input_no';
		document.getElementById(att).className='ckno';
		document.getElementById(att).innerHTML='对不起，您的卡号已经激活过，不能重复激活。';
		return false;
	}else{
		document.getElementById(att).className='ckok';
		document.getElementById(thisid).className='t_input';
		return true;
	}
}

function ck_name(){
	if (document.getElementById('name').value.length<2){
		document.getElementById('name').className='t_input_no';
		document.getElementById('msg1').className='ckno';
		document.getElementById('msg1').innerHTML='对不起，请认真填写你的姓名，否则激活无效。';
		return false;
	}else{
		document.getElementById('msg1').className='ckok';
		document.getElementById('name').className='t_input';
		return true;
	}
}

function ck_birth(){
	if (document.getElementById('birth').value.length<4){
		document.getElementById('birth').className='t_input_no';
		document.getElementById('msg2').className='ckno';
		document.getElementById('msg2').innerHTML='对不起，请认真填写你的出生日期。';
		return false;
	}else{
		document.getElementById('msg2').className='ckok';
		document.getElementById('birth').className='t_input';
		return true;
	}
}

function ck_cellphone(){
	var cellphone=document.getElementById('cellphone').value;
	var reg = /^0{0,1}(13[0-9]?|15[8-9]|15[0-1]|18[7-8])[0-9]{8}$/;
	if(!reg.test(cellphone)){
		document.getElementById('cellphone').className='t_input_no';
		document.getElementById('msg3').className='ckno';
		document.getElementById('msg3').innerHTML='对不起，请认真填写你的手机号码。';
		return false;
	}else{
		document.getElementById('msg3').className='ckok';
		document.getElementById('cellphone').className='t_input';
		return true;
	}
}

function ck_address(){
	var address=document.getElementById('address').value;
	if(address.length<5){
		document.getElementById('address').className='t_input_no';
		document.getElementById('msg4').className='ckno';
		document.getElementById('msg4').innerHTML='请尽量详细登记您的家庭住址（邮寄资料时用）。';
		return false;
	}else{
		document.getElementById('msg4').className='ckok';
		document.getElementById('address').className='t_input';
		return true;
	}
}

function ck_box(){
	if(document.getElementById('agree').checked==false){
		document.getElementById('msg5').className='ckno';
		document.getElementById('msg5').innerHTML='请仔细阅读服务协议，同意协议后方能激活信息。';
		return false;
	}else{
		document.getElementById('msg5').className='ckok';
		return true;
	}
}

function ck_all(){
	if ((ck_name()==true) && (ck_birth()==true) && (ck_cellphone()==true) && (ck_address()==true) && (ck_box()==true)){
		return true;
	}else{
		return false;
	}
}


